package com.yy.util.view;

import android.content.Context;
import android.widget.Toast;

/**
 * Created by zhangly on 15/9/30.
 */
public final class SingleToast {

    private static Toast mToastInstance;
    private static SingleToast mSingleToast = new SingleToast();

    private SingleToast() {}

    public static SingleToast get(Context context) {
        if(mToastInstance == null) {
            mToastInstance = Toast.makeText(context.getApplicationContext(), null, Toast.LENGTH_SHORT);
        }
        return mSingleToast;
    }

    public void show() {
        mToastInstance.show();
    }

    public SingleToast setText(String text) {
        mToastInstance.setText(text);
        return mSingleToast;
    }
}
